﻿-- =============================================
-- Author:      Sergey Solyanik
-- Create date: 7/25/09
-- Description: Adds a review
-- =============================================
CREATE PROCEDURE [dbo].[AddReview]
	@DocumentSetId INT,
	@Verdict TINYINT,
	@Comment NVARCHAR(MAX)
AS
    INSERT INTO dbo.Review (DocumentSetId, UserAlias, TimeStamp, Verdict, Comment)
        VALUES(@DocumentSetId, dbo.GetCurrentUserAlias(), GETUTCDATE(), @Verdict, @Comment)
    DECLARE @ReviewId INT = @@IDENTITY
    INSERT INTO dbo.EmailRequest (ReviewId) VALUES(@ReviewId)
RETURN 0